package com.yuanchu.media.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import com.yuanchu.common.validator.ValidationGroups;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 文件库分组记录表
 * 
 * @author adan
 * @email 2028038953@gmail.com
 * @date 2023-12-19 20:57:21
 */
@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
@Data
@TableName("yoshop_upload_group")
public class YoshopUploadGroupEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 分组ID
	 */
	@TableId
	private Integer groupId;
	/**
	 * 分组名称
	 */
	@NotBlank(message = "分组名称不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
	private String name;
	/**
	 * 上级分组ID
	 */
	@NotNull(message = "上级分组ID不能为空", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
	@JsonProperty("parent_id")
	private Integer parentId;
	/**
	 * 排序(数字越小越靠前)
	 */
	private Integer sort;
	/**
	 * 是否删除
	 */
	private Integer isDelete;
	/**
	 * 商城ID
	 */
	private Integer storeId;
	/**
	 * 创建时间
	 */
	private String createTime;
	/**
	 * 更新时间
	 */
	private String updateTime;

	@TableField(exist = false)
	private List<YoshopUploadGroupEntity> children;

}
